<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateHotelShowAllLink}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListHotelEmpty}" rendered="#{hotelController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{hotelController.items.rowCount > 0}">
                    <h:outputText value="#{hotelController.pagination.pageFirstItem + 1}..#{hotelController.pagination.pageLastItem + 1}/#{hotelController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{hotelController.previous}" value="#{bundle.Previous} #{hotelController.pagination.pageSize}" rendered="#{hotelController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{hotelController.next}" value="#{bundle.Next} #{hotelController.pagination.pageSize}" rendered="#{hotelController.pagination.hasNextPage}"/>&nbsp;
                    <h:dataTable value="#{hotelController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_idHotel}"/>
                            </f:facet>
                            <h:outputText value="#{item.idHotel}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_name}"/>
                            </f:facet>
                            <h:outputText value="#{item.name}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_brandName}"/>
                            </f:facet>
                            <h:outputText value="#{item.brandName}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_brandCode}"/>
                            </f:facet>
                            <h:outputText value="#{item.brandCode}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_country}"/>
                            </f:facet>
                            <h:outputText value="#{item.country}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_countryPhoneCode}"/>
                            </f:facet>
                            <h:outputText value="#{item.countryPhoneCode}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_address}"/>
                            </f:facet>
                            <h:outputText value="#{item.address}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_zip}"/>
                            </f:facet>
                            <h:outputText value="#{item.zip}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_categoryDescription}"/>
                            </f:facet>
                            <h:outputText value="#{item.categoryDescription}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_telephone}"/>
                            </f:facet>
                            <h:outputText value="#{item.telephone}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHotelTitle_conveniences}"/>
                            </f:facet>
                            <h:outputText value="#{item.conveniences}"/>
                        </h:column>
                        <h:column rendered="#{request.isUserInRole('admin')}">
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{hotelController.prepareView}" value="#{bundle.ListHotelViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{hotelController.prepareEdit}" value="#{bundle.ListHotelEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{hotelController.destroy}" value="#{bundle.ListHotelDestroyLink}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{hotelController.prepareCreate}" value="#{bundle.ListHotelCreateLink}" rendered="#{request.isUserInRole('admin')}"/>
            </h:form>
            <h:link value="Create a new hotel reservation " outcome="/hotelreservation/Create" />
        </ui:define>
    </ui:composition>

</html>
